/*     */
package com.iris.egrant.webapp.app.struts2.proposal;
/*     */
/*     */

import com.iris.egrant.app.service.proposal.ProposalLocalService;
import com.iris.egrant.app.utils.IrisStringUtils;
import com.iris.egrant.remote.http.service.ServiceFactory;
import com.iris.egrant.service.proposal.ProposalNoTransService;
import com.iris.egrant.web.struts2.Struts2Utils;
import net.sf.json.JSONObject;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.ObjectUtils;
import org.dom4j.DocumentException;
import org.springframework.data.redis.core.RedisTemplate;
import org.w3c.dom.Document;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */ public class SaveLocalAction
        /*     */ {
    /*     */   private static final long serialVersionUID = -5463600292608977004L;
    /*     */   private String prpCode;
    /*     */   private Long posCode;
    /*     */   private Long grantCode;
    /*     */   private Long productCode;
    /*     */   private String xmlData;
    /*     */   private Document productXml;
    /*     */   private String labName;
    /*     */   private String labType;
    /*     */   private String labNo;
    /*     */   private List<Map<String, Object>> prjList;
    /*     */
    @Resource(name = "serviceFactory")
    /*     */ private ServiceFactory serviceFactory;

    /*     */
    /*     */
    public Map<String, Object> savePrp() throws DocumentException {
        /*  58 */
        ProposalNoTransService proposalService = (ProposalNoTransService) this.serviceFactory.getService(ProposalNoTransService.class);
        /*  59 */
        Map<String, Object> result = proposalService.savePrp(this.posCode, this.grantCode, this.xmlData);
        /*  60 */
        String posCodeStr = (this.posCode == null) ? MapUtils.getString(result, "pos_code") : (this.posCode + "");
        /*  61 */
        ((ProposalLocalService) this.serviceFactory.getService(ProposalLocalService.class)).splitKnowledgePaper(Long.valueOf(posCodeStr));
        /*  62 */
        if (result.get("pos_code") != null) {
            /*  63 */
            this.posCode = Long.valueOf(result.get("pos_code").toString());
            /*     */
        }
        /*  65 */
        this.xmlData = ObjectUtils.toString(result.get("xmlData"));
        /*     */
///*  67 */     if (ObjectUtils.toString(result.get("message")).equalsIgnoreCase("isSubmit")) {
///*  68 */       int roleId = SecurityUtils.getCurrentUserRoleId();
///*  69 */       if (roleId == 3) {
///*  70 */         result.put("message", "sbdwSubmit");
///*  71 */       } else if (roleId == 26) {
///*  72 */         result.put("message", "sbrSubmit");
///*     */       }
///*     */     }
        /*     */
        try {
            /*  76 */
            ((ProposalLocalService) this.serviceFactory.getService(ProposalLocalService.class)).initPrjProgressData(this.posCode, "1001", "1");
            /*  77 */
        } catch (Exception e) {
            /*  78 */
            e.printStackTrace();
            /*     */
        }
        /*  80 */
        return result;
        /*     */
    }

    public String saveProposal() throws DocumentException {
        Map<String, Object> result = this.savePrp();
        Struts2Utils.renderText(JSONObject.fromObject(result).toString(), new String[0]);
        return null;
    }

    /*     */
    /*     */
    /*     */
    /*     */
    /*     */
    public String getPrpCode() {
        /* 178 */
        return this.prpCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setPrpCode(String prpCode) {
        /* 183 */
        this.prpCode = prpCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public Long getPosCode() {
        /* 188 */
        return this.posCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setPosCode(Long posCode) {
        /* 193 */
        this.posCode = posCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public Long getGrantCode() {
        /* 198 */
        return this.grantCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setGrantCode(Long grantCode) {
        /* 203 */
        this.grantCode = grantCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public Long getProductCode() {
        /* 208 */
        return this.productCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setProductCode(Long productCode) {
        /* 213 */
        this.productCode = productCode;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    /*     */
    public String getXmlData() {
        /* 219 */
        return this.xmlData;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setXmlData(String xmlData) {
        /* 224 */
        xmlData = IrisStringUtils.filterSupplementaryChars(xmlData);
        /* 225 */
        this.xmlData = xmlData;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public Document getProductXml() {
        /* 230 */
        return this.productXml;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setProductXml(Document productXml) {
        /* 235 */
        this.productXml = productXml;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public String getLabName() {
        /* 240 */
        return this.labName;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setLabName(String labName) {
        /* 245 */
        this.labName = labName;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public String getLabType() {
        /* 250 */
        return this.labType;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setLabType(String labType) {
        /* 255 */
        this.labType = labType;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public String getLabNo() {
        /* 260 */
        return this.labNo;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setLabNo(String labNo) {
        /* 265 */
        this.labNo = labNo;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public List<Map<String, Object>> getPrjList() {
        /* 270 */
        return this.prjList;
        /*     */
    }

    /*     */
    /*     */
    /*     */
    public void setPrjList(List<Map<String, Object>> prjList) {
        /* 275 */
        this.prjList = prjList;
        /*     */
    }

    /*     */
    /*     */
    public ServiceFactory getServiceFactory() {
        /* 279 */
        return this.serviceFactory;
        /*     */
    }

    /*     */
    /*     */
    public void setServiceFactory(ServiceFactory serviceFactory) {
        /* 283 */
        this.serviceFactory = serviceFactory;
        /*     */
    }
    /*     */
}


/* Location:              D:\文件\123\WEB-INF\classes\!\com\iris\egrant\webapp\app\struts2\proposal\SaveLocalAction.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */